/**
 * Created by xmgong on 2017/10/25.
 */
import React from 'react';
import {
    Text,
    View,
    StyleSheet,
    Image,
    ActionSheetIOS,
    InteractionManager,
    TouchableOpacity,
    NativeModules
}from 'react-native';
import moment from 'moment';

class ApplyRecordItem extends React.Component {

    render() {
        const rowData = this.props.record;
        let type = '';
        let accountid = '';
        let crash = '+' + '¥' + (rowData.applyMoney / 100).toFixed(2) + '元'; //提现金额
        if (rowData.type == '1') {
            type = rowData.bankName;
            accountid = rowData.bankId;
        }

        let applydate = moment.unix(rowData.applyDate / 1000).format("YYYY-MM-DD HH:mm:ss")
        let applystate = '';

        if (rowData.state == '1') {
            applystate = '提现中';
        } else if (rowData.state == '-1') {
            applystate = '提现失败';
        } else {
            applystate = '提现完成';
        }

        return (
            <View style={{
                flex: 1,
                flexDirection: 'column',
                paddingLeft: 20,
                paddingRight: 20,
                paddingTop: 10,
                paddingBottom: 10,
                backgroundColor: 'white'
            }}>
                <View style={{flexDirection: 'row', alignItems: 'center', justifyContent: 'space-between',}}>
                    <Text style={{fontSize: 16}}>{type}</Text>
                    <Text style={{fontSize: 16}}>{applystate}</Text>
                </View>
                <Text style={{marginTop: 10, fontSize: 16}}>{accountid}</Text>
                <View style={{
                    flexDirection: 'row',
                    alignItems: 'center',
                    justifyContent: 'space-between',
                    marginTop: 10
                }}>
                    <Text style={{fontSize: 13}}>{applydate}</Text>
                    <Text style={{fontSize: 20, color: 'red'}}> {crash}</Text>
                </View>
            </View>
        );
    }
}

export  default  ApplyRecordItem;
